using MS.Core.JsonConverters;
using Newtonsoft.Json;
using SqlSugar;

namespace ReportDesignerServer.DataModels
{

    /// <summary>
    /// 用户实体
    /// </summary>
    [SugarTable("sys_user")]
    public class User
    {
        /// <summary>
        /// 主键
        /// </summary>
        [JsonConverter(typeof(LongToStringConverter))]
        [SugarColumn(IsPrimaryKey = true)]
        public long id { get; set; }
 

        /// <summary>
        /// 用户名
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true)]
        public string? username { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true)]
        public string? nickname { get; set; }

        /// <summary>
        /// 性别((1-男 2-女 0-保密)
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true)]
        [JsonConverter(typeof(IntToStringConverter))]
        public int? gender { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true,IsOnlyIgnoreUpdate = true)]
        public string? password { get; set; }

        /// <summary>
        /// 部门ID
        /// </summary>
        /// 
        [JsonConverter(typeof(LongToStringConverter))]
        [SugarColumn(IsNullable = true)]
        public long deptId { get; set; }


        /// <summary>
        /// 角色ids
        /// </summary>
        /// 

        [SugarColumn(IsIgnore = true)]
        public List<string> roles { get; set; }
        /// <summary>
        /// 部门名称
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true,IsIgnore =true)]
        public string? deptName { get; set; }

        /// <summary>
        /// 用户头像
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true)]
        public string? avatar { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        /// 

        [SugarColumn(IsNullable = true)]
        public string? mobile { get; set; }

        /// <summary>
        /// 状态((1-正常 0-禁用)
        /// </summary>
        /// 
        [JsonConverter(typeof(IntToStringConverter))]
        [SugarColumn(IsNullable = true)]
        public int? status { get; set; }

        /// </summary>
        /// 用户邮箱
        /// </summary>
        /// 
        [SugarColumn(IsNullable = true)]
        public string? email { get; set; }

        [SugarColumn(IsNullable = true)]
        public DateTime? create_time { get; set; }

        /// <summary>
        /// 创建人 ID
        /// </summary>
        /// 

        [SugarColumn(IsNullable = true)]
        public long? createBy { get; set; }


        [SugarColumn(IsNullable = true)]
        public DateTime? update_time { get; set; }
        /// <summary>
        /// 更新人 ID
        /// </summary>
        /// 

        [SugarColumn(IsNullable = true)]
        public long? updateBy { get; set; }

        /// <summary>
        /// 是否删除(0-否 1-是)
        /// </summary>
        /// 

        [SugarColumn(IsNullable = true)]
        public int? isDeleted { get; set; }

        /// <summary>
        /// 微信 OpenID
        /// </summary>
        /// 

        [SugarColumn(IsNullable = true)]
        public string? openid { get; set; }
    }
}